package com.example.diancai.websocket.exception;

import lombok.Getter;

public class ServiceException extends RuntimeException {

    /**
     * -- GETTER --
     *
     * @return code
     */
    @Getter
    private Integer code;

    private String msg;

    public ServiceException(Integer code, String msg) {
        super();
        this.msg = msg;
        this.code = code;
    }

    public ServiceException(String msg) {
        this(1, msg);
    }

    @Override
    public String getMessage() {
        return msg;
    }

}
